<template>
    <div id="resume">

        <div style="float:right;text-align:center">
            <span>简 历 完 整 度 🔖</span>
             <el-progress type="dashboard" :percentage="percentage" :color="colors"></el-progress>
             <button type="button" class="btn btn-primary" @click="importWord">导出word</button>
</div>
         <el-tabs :tab-position="tabPosition">
        <el-tab-pane label="个人基本资料">
           <resumebasic @resumTest='resumTest' v-if="isRouterAlive"></resumebasic>
        </el-tab-pane>
        <el-tab-pane label="个人优势">
            <advantage @resumTest='resumTest' v-if="isRouterAlive"></advantage>
        </el-tab-pane>
        <el-tab-pane label="求职期望">
            <resumebasicjobexpectations @resumTest='resumTest' @delPercentage="delPercentage" v-if="isRouterAlive"></resumebasicjobexpectations>
        </el-tab-pane>
        <el-tab-pane label="求职状态">
         <resumebasicjobsearchingstatus  @resumTest='resumTest' @delPercentage="delPercentage" v-if="isRouterAlive"></resumebasicjobsearchingstatus>
        </el-tab-pane>
        <el-tab-pane label="个人技能">
            <resumebasicpersonalskills @resumTest='resumTest' @delPercentage="delPercentage" v-if="isRouterAlive"></resumebasicpersonalskills>
        </el-tab-pane>
        <el-tab-pane label="工作经历">
            <workexperience @resumTest='resumTest' @delPercentage="delPercentage" v-if="isRouterAlive"></workexperience>
        </el-tab-pane>
        <el-tab-pane label="项目经历">
            <item @resumTest='resumTest'  @delPercentage="delPercentage" v-if="isRouterAlive"></item>
        </el-tab-pane>
        <el-tab-pane label="教育经历">
            <education @resumTest='resumTest' @delPercentage="delPercentage" v-if="isRouterAlive"></education>
        </el-tab-pane>
        <el-tab-pane label="社会主页">
            <social @resumTest='resumTest' ref="social" @delPercentage="delPercentage"  v-if="isRouterAlive"></social>
        </el-tab-pane>
        <el-tab-pane label="附件">
            <imageOne @resumTest='resumTest' @delPercentage="delPercentage" v-if="isRouterAlive"></imageOne>
        </el-tab-pane>
        </el-tabs>
    </div>
</template>
<script>
import workexperience from './workexperience'
import resumebasicjobexpectations from './resumebasic-job-expectations'
import resumebasicjobsearchingstatus from './resumebasic-job-searching-status'
import resumebasicpersonalskills from './resumebasic-personal-skills'
import social from './social'
import item from './item'
import imageOne from './image'
import education from './education'
import resumebasic from './resumebasic'
import advantage from './advantage'
export default {
    name:'Resume',
    provide(){
        return{
            reload:this.reload
        }
    },
    data(){
        return{
             tabPosition: 'left',
              percentage: 0,
              num:0,

          colors: '#f56c6c',
          isRouterAlive:true

        }
    },
    components:{
        workexperience,resumebasicjobexpectations,item,resumebasic,advantage,imageOne,education,social,resumebasicjobsearchingstatus,resumebasicpersonalskills
    },
    methods:{
          resumTest(){
            if(this.percentage<100){
                this.percentage=this.percentage+10;
            }
          },
          reload(){
              this.isRouterAlive=false;
              this.$nextTick(function(){
                  this.isRouterAlive=true;
              })
          },
          delPercentage(){
               this.percentage=10;
          },
          importWord(){
                   var resume = JSON.parse(localStorage.getItem("resume"))
                  location.href=`http://localhost:8868/api/resume/word/exportWord/${resume.id}`
              
          }
    },
    mounted(){

    }
}
</script>

